package com.atguigu.behavior.strategy;

import lombok.Data;
import lombok.Setter;


public abstract class Duck {
    @Setter
    FlyBehavior flyBehavior;
    @Setter
    QuackBehavior quackBehavior;

    public abstract void init();

    public void fly(){
        if(flyBehavior!=null){
            flyBehavior.fly();
        }
    }

    public void quack(){
        if (quackBehavior!=null) {
            quackBehavior.quack();
        }
    }

}
